import store from '@/store'
import axios from "axios";
let http = axios.create({
    // 基准地址
    baseURL: 'https://www.liulongbin.top:8888/api/private/v1/',
    // 超时时间
    timeout: 5000
})
// 请求拦截
http.interceptors.request.use(confing => {
    if (store.state.token) {
        confing.headers.Authorization = store.state.token
    }
    return confing
})
// 响应拦截
http.interceptors.response.use(res => {
    return res.data
})

export default http